package gyb.rasa.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import gyb.rasa.entity.MessageReceived;
import com.baomidou.mybatisplus.extension.service.IService;
import gyb.rasa.entity.RasaMsg;
import gyb.rasa.entity.RasaResponse;
import gyb.rasa.entity.vo.HotQuestion;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 郜宇博
 * @since 2023-04-02
 */
public interface MessageReceivedService extends IService<MessageReceived> {

    /**
     * 存储会话
     * @param rasaMsg 问题 和 请求uid
     * @param request http请求
     * @param response 回复
     * @return mid
     */
    int addChat(RasaMsg rasaMsg, HttpServletRequest request, ArrayList<Map<String,String>> response);

    /**
     * 获取HotQuestion格式的问答
     * @param mid message_receive主键
     * @return HotQuestion格式的question
     */
    HotQuestion getMessageReceiveTransformHotQuestion(Integer mid);

    /**
     * 获取最佳回复
     * @return HotQuestionList
     */
    List<HotQuestion> getGoodResponses(Integer count);

    /**
     * 获取messages页码格式
     * @param current 页数
     * @param limit 每页大小
     * @param  good 是否以最佳为倒叙
     * @return IPage
     */
    IPage<MessageReceived> getMessageListByPage(Long current, Long limit,Integer good);

    /**
     * 分页通过uid获取message
     * @param uid 用户id
     * @return messageList
     */
    IPage<MessageReceived> getMessageByUid(Long current,Long limit, Integer uid,HttpServletRequest httpServletRequest);
}
